import request from '../../utils/request';
let baseRequest_url = "http://127.0.0.1:4890/portal";
//  --------------------------------------------------------------------------------------------------------------- //
// 商品分页列表查询
export const findProductInfoListPage = query => {
    return request({
        url: baseRequest_url+'/admin/product/findProductInfoListPage',
        method: 'get',
		params: query
    });
};
// 商品详情查询
export const findProductInfoListById = query => {
    return request({
        url: baseRequest_url+'/admin/product/findProductInfoListById/'+query,
        method: 'get',
    });
};
// 新增编辑商品信息
export const addProductInfo = data => {
    return request({
        url: baseRequest_url+'/admin/product/saveProductInfo',
        method: 'post',
		data: data,
	});
};
// 新增编辑商品信息
export const saveProductInfo = data => {
    return request({
        url: baseRequest_url+'/admin/product/saveProductInfo',
        method: 'put',
		data: data,
	});
};
// 删除商品信息
export const deleteProductById = query => {
    return request({
        url: baseRequest_url+'/admin/product/deleteProductInfoById/'+query,
        method: 'delete',
    });
};
// 批量更新商品发布状态
export const batchEditProductPublish = data => {
    return request({
        url: baseRequest_url+'/admin/product/batchEditProductPublish',
        method: 'put',
        data: data
    });
};

// 商品回收站
export const findDropProductInfoListPage = param => {
    return request({
        url: baseRequest_url+'/admin/product/findDropProductInfoListPage',
        method: 'get',
        params: param
    });
};
// 恢复商品
export const recoveryProduct = data => {
    return request({
        url: baseRequest_url+'/admin/product/recoveryProduct',
        method: 'put',
        data: data
    });
};
//  --------------------------------------------------------------------------------------------------------------- //
// 新增编辑商品属性
export const saveProductAttrInfo = data => {
    return request({
        url: baseRequest_url+'/admin/product/saveProductAttrInfo',
        method: 'put',
		data: data,
    });
};
// 新增编辑商品规格
export const saveProductSpecInfo = data => {
    return request({
        url: baseRequest_url+'/admin/product/saveProductSpecInfo',
        method: 'put',
		data: data,
    });
};
// 删除商品规格
export const deleteProductSpecInfoById = query => {
    return request({
        url: baseRequest_url+'/admin/product/deleteProductSpecInfoById/'+query,
        method: 'delete',
    });
};